Skip to content

REF: stop DatetimeArray methods from reading self.freq#65209

Merged
mroeschke merged 4 commits intopandas-dev:mainfrom
jbrockmendel:ref-array-no-freq-5
Apr 14, 2026
Merged

REF: stop DatetimeArray methods from reading self.freq#65209
mroeschke merged 4 commits intopandas-dev:mainfrom
jbrockmendel:ref-array-no-freq-5

Conversation

@jbrockmendel
Copy link
Copy Markdown
Member

Summary

  • DatetimeArray methods (tz_convert, tz_localize, normalize, to_period, is_month_start/end, is_quarter_start/end, is_year_start/end) no longer read self.freq for computation
  • Freq management for these methods is handled by DatetimeIndex overrides
  • Part of GH#24566 (moving freq from DTA/TDA arrays to Index)

Test plan

  • pytest pandas/tests/indexes/datetimes/ -x -q (3558 passed)
  • pytest pandas/tests/series/accessors/test_dt_accessor.py -x -q (315 passed)
  • pre-commit checks pass
  • mypy clean (no new errors)

🤖 Generated with Claude Code

@jbrockmendel jbrockmendel added the Refactor Internal refactoring of code label Apr 13, 2026
jbrockmendel and others added 3 commits April 13, 2026 15:26
Array methods (tz_convert, tz_localize, normalize, to_period,
is_month_start/end, is_quarter_start/end, is_year_start/end)
no longer read self.freq. Freq management is handled by
DatetimeIndex overrides.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…date test expectation

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@mroeschke mroeschke added this to the 3.1 milestone Apr 14, 2026
@mroeschke mroeschke merged commit b7be5a4 into pandas-dev:main Apr 14, 2026
45 checks passed
@mroeschke
Copy link
Copy Markdown
Member

Thanks @jbrockmendel

@jbrockmendel jbrockmendel deleted the ref-array-no-freq-5 branch April 14, 2026 16:33
Sharl0tteIsTaken added a commit to Sharl0tteIsTaken/pandas that referenced this pull request Apr 15, 2026
…h-origin

* upstream/main: (68 commits)
  BUG: loc setitem with duplicate columns and new columns corrupts Data… (pandas-dev#65208)
  BLD: remove deprecated option cpython-freethreading (pandas-dev#65216)
  ENH: Support axis parameter in masked array reductions for 2D arrays (pandas-dev#64802)
  REF: stop DatetimeArray methods from reading self.freq (pandas-dev#65209)
  BUG: DataFrame.duplicated() loses index when DataFrame has no columns (pandas-dev#65217)
  CI: Add contents:write permission to relock workflow; relock (pandas-dev#65196)
  TYP: fix mypy errors in get_values_for_csv (pandas-dev#65214)
  REF: stop array from propagating freq in core operations (pandas-dev#65191)
  Bump pypa/gh-action-pypi-publish from 1.13.0 to 1.14.0 (pandas-dev#65206)
  REF: Move freq-based factorize short-circuit from array to Index (pandas-dev#65182)
  Bump actions/upload-artifact from 7.0.0 to 7.0.1 (pandas-dev#65203)
  REF: merge PeriodArray branch in get_values_for_csv (pandas-dev#65198)
  REF: remove unused nat_rep parameter from datetime/timedelta formatters (pandas-dev#65161)
  CI: Fix numpy nightly build (pandas-dev#65197)
  Bump peter-evans/create-pull-request from 8.1.0 to 8.1.1 (pandas-dev#65207)
  Bump mymindstorm/setup-emsdk from 15 to 16 (pandas-dev#65204)
  Bump actions/github-script from 8.0.0 to 9.0.0 (pandas-dev#65202)
  REF: move resolution, resolution_obj from arrays to indexes (pandas-dev#65185)
  CLN: ASV config, use rattler for environment solving (pandas-dev#65153)
  REF: remove _Datetime64TZFormatter in favor of _Datetime64Formatter (pandas-dev#65171)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Refactor Internal refactoring of code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants